﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SharpSoft.Lexing
{
    /// <summary>
    /// 描述文本源中的一段
    /// </summary>
    public struct TextSourceSpan
    {
        /// <summary>
        /// 开始位置
        /// </summary>
        public readonly int Start;
        /// <summary>
        /// 长度
        /// </summary>
        public readonly int Length;

        public TextSourceSpan(int start, int length)
        {
            Start = start;
            Length = length;
        }
        /// <summary>
        /// 结束位置
        /// </summary>
        public int EndPos
        {
            get { return Start + Length; }
        }
    }
}
